<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style>
		ul {
			overflow: hidden;
			padding: 20px;
		}
		li {
			float: left;
			width: 300px; height: 300px;
			border: 1px solid black;
		}
		div {
			width: 100px;
			height: 100px;
			border: 1px solid black;
		}
	</style>
</head>
<body>
	<ul>
		<li>
			<div></div>
		</li>
		<li>
			<div></div>
		</li>
		<li>
			<div></div>
		</li>
		<li>
			<div></div>
		</li>
		<li>
			<div></div>
		</li>
	</ul>
	<script>
		var ul = document.querySelector('ul');
		ul.onclick = function (ev) {
			var ev = ev || window.event;
			var target = ev.target;
			if (target == ev.currentTarget) {
				target.style.background = '#fb3';
			}
			switch (target.tagName) {
				case 'LI':
					target.style.background = 'red';
					break;
				case 'DIV':
					target.style.background = '#58a';
					break;
				default:
					// statements_def
					break;
			}
		}
	</script>
</body>
</html>